#include "rtc_api.h"
#include "rtc_board.h"

static uint32_t RtcTimeCompensation = 0;

// void RtcGetDeviceTime(uint32_t pDeviceTime)
// {
//   if (pDeviceTime != NULL)
//   {
//     uint32_t DeviceTimestamp = RTC_GetCounter() / 10000;
//     uint32_t ConversionsTimestamp = DeviceTimestamp + RtcTimeCompensation;

//     TimestampToNormalTime(ConversionsTimestamp, pDeviceTime);
//      PRINT("ConversionsTimestamp %02x \r\n",ConversionsTimestamp);
//   }
// }

// bool RtcUpdateDeviceTime(uint32_t UpdateTimestamp)
// {
//   uint32_t InternalTime = 0;
//   PRINT("set time\r\n");
//   if ((UpdateTimestamp != 0) && (UpdateTimestamp != 0xFFFFFFFF))
//   {
//     InternalTime = RTC_GetCounter() / 10000;
//     RtcTimeCompensation = UpdateTimestamp - InternalTime;
//     PRINT("RtcTimeCompensation %0x InternalTime %0x UpdateTimestamp %02x \r\n",RtcTimeCompensation,InternalTime,UpdateTimestamp);
//     return true;
//   }

//   return false;
// }
